<?php
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://www.youdi365.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author:  心云间、凝听 <981248356@qq.com>
// +----------------------------------------------------------------------

namespace Common\Widget;

use Think\Controller;

class AttachmentWidget extends Controller{
    //附件管理
    protected $attachmentModel;

    function _initialize()
    {
        $this->attachmentModel = D('Admin/Attachment');
    }
    public function lists($data,$meta_title='图片选择器',$paged=1,$number=24)
    {
         $this->assign('field',$data);
    	$this->meta_title =$meta_title;
        $map['status']=1;
        list($file_list,$page_totalCount)=$this->attachmentModel->getListByPage($map,$paged,$order='sort asc,update_time desc',$field='*',$number);
        $this->assign('attachment_list_data',$file_list);//附件列表数据
        $page = new \Think\Page($page_totalCount,$number);
        $this->assign('table_data_page',$page->show());
        $this->display(T('Application://Common@Widget/attachment'));
    }

} 